home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktimeintro / createmovie / completed lab / qtflatten.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-10-06  |  1.6 KB  |  44 lines

  1. #include <Movies.h>
  2.  
  3. #include "QTUtilities.h"
  4. #include "QTFlatten.h"
  5. #include "CreateMovie.h"
  6. #include "ComFramework.h"
  7.  
  8. /************************************************************
  9. *                                                           *
  10. *                                                            *
  11. *  QTSave_FlattenMovie                                        *                    
  12. *  Save and flatten a movie resource into a file.            *
  13. *                                                           *
  14. *                                                           *
  15. *************************************************************/
  16.  
  17. OSErr QTSave_FlattenMovie (Movie theMovie, FSSpec *myFile)
  18. {
  19.     Movie    aMovie = NULL;
  20.     OSErr    myErr = noErr;
  21.  
  22.     // The FlattenMovieData function creates a new movie file and creates a new movie
  23.     // that contains all of its movie data.
  24.     // NOTE: Unlike the FlattenMovie, this function does not add the new movie resource
  25.     // to the new movie file. Instead, the FlattenMovieData function returns the new
  26.     // movie to your application. Your application must dispose of the returned movie.
  27.             
  28.         aMovie = FlattenMovieData(theMovie,                            /* movie specifier */
  29.                                    flattenAddMovieToDataFork |        /* moive flatten flags */    
  30.                                   flattenForceMovieResourceBeforeMovieData,
  31.                                   myFile,                            /* FSSpec for creted movie */
  32.                                    FOUR_CHAR_CODE('TVOD'),            /* creator */
  33.                                    smSystemScript,                     /* script tag */
  34.                                    createMovieFileDeleteCurFile |    /* creation flags */
  35.                                    createMovieFileDontCreateResFile);
  36.         
  37.         myErr = GetMoviesError();
  38.         CheckError( myErr, "FlattenMovie error" );
  39.         
  40.         if (aMovie != NULL)
  41.             DisposeMovie(theMovie);
  42.             
  43.     return myErr;
  44. }